import React from "../src/react";
import ReactDOM from "../src/react-dom/client";
// import React from "react";
// import ReactDOM from "react-dom";
class ParentComponent extends React.Component{
  constructor(props){
    super(props);
    this.state = {
      list: ['A','B','C','D'],
      number: 1
    }
  }
  
  handleClick = () =>{
    this.setState({
      list: ['A','F']
    })
  }
  // shouldComponentUpdate(){
  //   return false;
  // }
  render(){
    return <div>
        <button onClick={this.handleClick}>点击</button>
        <ul>
          {
            this.state.list.map(item => (
              <li key={item}>{item}</li>
            ))
          }
        </ul>
      </div>
    
  }
}

const root = ReactDOM.createRoot(document.getElementById('root'));

root.render(<ParentComponent />)
